package cn.net.autocode.platform.customDict.dict;

import cn.net.autocode.core.bean.ResultT;
import cn.net.autocode.dbManager.Dao;
import cn.net.autocode.platform.customDict.CustomDict;
import cn.net.autocode.platform.customDict.CustomDictAnnotation;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.stereotype.Component;

@CustomDictAnnotation("wfAuthType")
@Component("autocode_platform_wfauth_type")
public class WfAuthTypeDict implements CustomDict {

    private final Dao dao;

    public WfAuthTypeDict(Dao dao) {
        this.dao = dao;
    }

    @Override
    public ResultT query(JSONObject param) {
        String sql = "select code value,label from autocode_wf_audit_type where active='Y' order by sort_no";
        JSONArray array = dao.queryJSONArray(sql);
        return ResultT.success(array);
    }
}
